Skip to content

RDKB-64839 Fix memory leaks in bus_insert_elem_node on duplicate elem…#1142

Merged
narendradandu merged 1 commit into
rdkcentral:mainfrom
WellPeter:RDKB-64839_main
May 25, 2026
Merged

RDKB-64839 Fix memory leaks in bus_insert_elem_node on duplicate elem…#1142
narendradandu merged 1 commit into
rdkcentral:mainfrom
WellPeter:RDKB-64839_main

Conversation

@WellPeter

Copy link
Copy Markdown
Contributor

…ent insertion

Reason for change: Memory leak in onewifi process
Test Procedure: Debug
Priority: P1
Risks: Low

…ent insertion

Reason for change: Memory leak in onewifi process
Test Procedure: Debug
Priority: P1
Risks: Low

Signed-off-by: Petro Krynytskyi <petr0krynytskiy@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a memory leak in bus_insert_elem_node() when inserting an element whose node already exists (duplicate insert), improving stability of the onewifi process.

Changes:

  • Free previously allocated current_node->node_elem_data before overwriting it on re-insert to prevent leaks.
  • Avoid creating a new table row template ({i}) when a table node already has a child, preventing child-node leaks/overwrites on duplicate inserts.
  • Add cleanup for node_elem_data when table row-template allocation fails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/platform/common/bus_common.c
@WellPeter WellPeter marked this pull request as ready for review May 21, 2026 14:42
@WellPeter WellPeter marked this pull request as draft May 22, 2026 12:19
@WellPeter WellPeter marked this pull request as ready for review May 22, 2026 16:18
@narendradandu narendradandu merged commit 4ad7baf into rdkcentral:main May 25, 2026
9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants